<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<lv-datatable [lvData]='filesetData' #lvTable [lvPaginator]='page' lvSize="small" lvAsync>
    <thead>
        <tr>
            <ng-container *ngFor="let col of columns">
                <th lvCellKey="{{ col.key }}">{{ col.label}}</th>
            </ng-container>
        </tr>
    </thead>
    <tbody>
        <ng-container *ngFor='let item of lvTable.renderData'>
            <tr>
                <ng-container *ngFor="let col of columns">
                    <td>
                        <ng-container [ngSwitch]="col.key">
                            <ng-container *ngSwitchCase="'sla_name'">
                                <ng-container *ngIf="item.sla_id;else emptyTpl">
                                    <span class="aui-link" id='outerClosable' (click)="getSlaDetail(item)" lv-overflow>
                                        <sla-type [name]="item.sla_name"></sla-type>
                                    </span>
                                </ng-container>
                            </ng-container>
                            <ng-container *ngSwitchCase="'protection_status'">
                                <aui-status [value]="item.protection_status" type="Protection_Status">
                                </aui-status>
                            </ng-container>
                            <ng-container *ngSwitchDefault>
                                <span lv-overflow>
                                    {{item[col.key] | nil}}
                                </span>
                            </ng-container>
                        </ng-container>
                    </td>
                </ng-container>
            </tr>
        </ng-container>
    </tbody>
</lv-datatable>
<lv-paginator #page lvMode="simple" [lvShowPageSizeOptions]="false" [lvPageSizeOptions]="sizeOptions"
    [lvPageSize]="pageSize" [lvTotal]="total" [lvPageIndex]="pageIndex" (lvPageChange)="pageChange($event)"
    [hidden]="!total"></lv-paginator>
<ng-template #emptyTpl>
    --
</ng-template>
